class MeetingRoomsController < ApplicationController
	
  def index
    @meeting_rooms = MeetingRoom.all
  end
  
  def show
    @meeting_room = MeetingRoom.find(params[:id])
  end
  
  def new
    @meeting_room = MeetingRoom.new
  end
  
  def create
    @meeting_room = MeetingRoom.new(params[:meeting_room])
    if @meeting_room.save
      flash[:notice] = "Successfully created meeting room."
      redirect_to @meeting_room
    else
      render :action => 'new'
    end
  end
  
  def edit
    @meeting_room = MeetingRoom.find(params[:id])
  end
  
  def update
    @meeting_room = MeetingRoom.find(params[:id])
    if @meeting_room.update_attributes(params[:meeting_room])
      flash[:notice] = "Successfully updated meeting room."
      redirect_to @meeting_room
    else
      render :action => 'edit'
    end
  end
  
  def destroy
    @meeting_room = MeetingRoom.find(params[:id])
    @meeting_room.destroy
    flash[:notice] = "Successfully destroyed meeting room."
    redirect_to meeting_rooms_url
  end
end
